dispatch

fun CoroutineDispatcher.dispatch(block: Runnable)

Provide an easy way to dispatch tasks to the main thread. For example, to run a block on the main thread without suspending the calling code, use:

Dispatchers.Main.dispatch {
println("your UI code here")
}